package wnhz.com.business.shareshop.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.WindowManager;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import wnhz.com.business.R;
import wnhz.com.business.base.BaseActivity;
import wnhz.com.business.base.BaseRVAdapter;
import wnhz.com.business.base.BaseViewHolder;
import wnhz.com.business.groupshop.ui.CreditCheatsActivity;
import wnhz.com.business.impl.ActionBarClickListener;
import wnhz.com.business.view.TranslucentActionBar;

/**
 * 信用值
 */
public class CreditNumActivityS extends BaseActivity implements ActionBarClickListener {

    @BindView(R.id.actionbar)
    TranslucentActionBar actionbar;
    @BindView(R.id.tv_crrditnum)
    TextView tvCrrditnum;
    @BindView(R.id.recycler_recode)
    RecyclerView recyclerRecode;

    //假数据
    public static List<String> test = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_credit_nums);
        ButterKnife.bind(this);

//        actionbar.setData("我的信用值", R.drawable.ic_lefft_white, null, 0, "信用秘籍", 0, this);
        actionbar.setData("我的信用值", R.drawable.ic_lefft_white, null, 0, null, 0, this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            actionbar.setStatusBarHeight(getStatusBarHeight());
        }

        initview();
        setRecyclerRecode();
    }


    public static Intent createIntent(Context context) {
        Intent intent = new Intent(context, CreditNumActivityS.class);
        return intent;
    }

    private void initview() {
        test.clear();
        recyclerRecode.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        for (int i = 0; i < 5; i++) {
            test.add("test" + i);

        }
    }

    private void setRecyclerRecode() {
        recyclerRecode.setAdapter(new BaseRVAdapter(this, test) {
            @Override
            public int getLayoutId(int viewType) {
                return R.layout.item_creditnum;
            }

            @Override
            public void onBind(BaseViewHolder holder, int position) {

            }

            @Override
            public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

            }
        });
    }

    @Override
    public void onLeftClick() {
        finish();
    }

    @Override
    public void onRightClick() {
//        startActivity(CreditCheatsActivity.createIntent(this));
    }

    @Override
    public void onEditTextClick() {

    }
}
